/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sgii;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.sql.Array;

/**
 * 
 *
 * @author Nicolas
 */
public class TxtReader {
   public static void ImportarProductsTxt(String fileLocation) throws FileNotFoundException, IOException 
             {  
                 String block[];    
                 String item;
                 BufferedReader itemsFile = new BufferedReader(new FileReader(fileLocation));
                 itemsFile.readLine();
                 while ((item = itemsFile.readLine())!=null) {
                            System.out.println(item);
                           block = item.split("\\|");
                           //Aca los inserto en la bd, Id block[0], nombre block[1], y envase block[2]
                             System.out.println(block[1]);
                        }
             }
    public static void ImportarRegionsTxt(String fileLocation) throws FileNotFoundException, IOException 
             {  
                 String block[];    
                 String item;
                 BufferedReader itemsFile = new BufferedReader(new FileReader(fileLocation));
                 itemsFile.readLine();
                 while ((item = itemsFile.readLine())!=null) {
                            System.out.println(item);
                           block = item.split("\\|");
                           //Aca los inserto en la bd, Id block[0], nombre block[1], y envase block[2]
                             System.out.println(block[1]);
                        }
             }
     public static void ImportarStockTxt(String fileLocation) throws FileNotFoundException, IOException 
             {  
                 String block[];    
                 String item;
                 BufferedReader itemsFile = new BufferedReader(new FileReader(fileLocation));
                 itemsFile.readLine();
                 while ((item = itemsFile.readLine())!=null) {
                            System.out.println(item);
                           block = item.split("\\|");
                           //Aca los inserto en la bd, Id block[0], nombre block[1], y envase block[2]
                             System.out.println(block[1]);
                        }
             }

}
